<template>
  <div class="app-container">
    <el-row>
      <el-col :span="24">
        <p style="font-weight:bold;">索引名称: new_standard_all</p>
        <el-divider></el-divider>
        <p style="font-weight:bold;">索引情况查询</p>
        <p >{{seachIndex}}</p>
        <el-button type="primary"  @click="searchIndex">索引情况查询</el-button>
        <el-input v-model="calTableName" placeholder="请输入表名" style="width: 200px; margin-left: 10px;"></el-input>
        <el-button type="primary"  @click="dataCal" style="margin-left: 10px;">数据校验</el-button>
        <el-button type="primary"  @click="updateCal" style="margin-left: 10px;">数据同步</el-button>
        <el-divider></el-divider>
        <!-- <p style="font-weight:bold;">创建索引</p>
        <p>{{creatIndexs}}</p>
        <el-button type="primary"  @click="createIndexb">创建索引</el-button>
        <el-divider></el-divider>
        <p style="font-weight:bold;">删除所有索引</p>
        <p>{{deleteIndexresult}}</p>
        <el-button type="primary"  @click="deleteall">删除索引</el-button>
        <el-divider></el-divider>
        <p style="font-weight:bold;">根据id删除索引</p>
        <p>{{deleteIndexByIdresult}}</p>
        <el-button type="primary">根据id删除索引</el-button>
        <el-divider></el-divider>
        <p style="font-weight:bold;">根据表名添加索引数据</p>
        <p>{{adddocbytablename}}</p>
        <el-button type="primary">根据表名添加索引</el-button>
        <el-divider></el-divider> -->
        <!-- <p style="font-weight:bold;">初始化所有数据</p> -->
        <p>{{intitalldoc}}</p>
        <!-- <el-button type="primary" @click="initall">初始化所有数据</el-button> -->
        <!-- <el-divider></el-divider>
        <p style="font-weight:bold;">根据表名检索文件</p>
        <p>{{initfilebytablename}}</p>
        <el-button type="primary">根据表名初始化文件</el-button> -->
        <el-divider></el-divider>
        <!-- <p style="font-weight:bold;">初始化所有文件</p> -->
        <p>{{initallfilet}}</p>
        <!-- <el-button type="primary" @click="initAllFileb">初始化所有文件</el-button> -->
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {
  createIndex,
  searchIndex,
  delteIndex,
  adddocall,
  initAllFile
} from "@/api/system/searchengine.js";
import {calTableName,calUpdate} from "@/api/system/standardNoes.js";
import pdf from 'vue-pdf'
export default {
  name: "Db15",
  dicts: ['standard_a200'],
  data() {
    return {
      // 遮罩层
      loading: true,
      //索引情况
      seachIndex: '',
      //创建索引
      creatIndexs: '',
      deleteIndexresult: '',
      deleteIndexByIdresult: '',
      adddocbytablename: '',
      intitalldoc: '',
      initfilebytablename: '',
      initallfilet: '',
      // 表名输入
      calTableName: ''
    };
  },
  components: { pdf },
  created() {

  },
  watch: {

  },
  methods: {
    /** 查询Standard列表 */
    createIndexb() {
      createIndex().then((response)=>{
        this.creatIndexs = response
      })
    },
    searchIndex(){
      searchIndex().then((response)=>{
        this.seachIndex = response
      })
    },
    dataCal(){
      calTableName(this.calTableName).then((response)=>{
        
      })
    },
    updateCal(){
      calUpdate().then((response)=>{
       
      })
    },
    deleteall(){
      delteIndex().then((response)=>{
        this.deleteIndexresult = response
      })
    },
    initall(){
      adddocall().then((response)=>{
        this.intitalldoc = response
      })
    },
    initAllFileb(){
      initAllFile().then((response)=>{
        this.initallfilet = response
      })
    }

  },
};
</script>